<template>
  <section>
    <el-col :span="24" class="toolbar" style="padding-bottom: 0px">
      <el-button @click="handleMyFiles">我的文件</el-button>
      <el-button @click="handleWaitSign">待签文件</el-button>
      <el-button @click="handleArchived">归档文件</el-button>
    </el-col>
    <my-file v-show="activeName=='myFiles'" ref="myFiles"></my-file>
    <wait-sign v-show="activeName=='waitSign'" ref="waitSignFiles"></wait-sign>
    <archived-file v-show="activeName=='archived'" ref="archivedFiles"></archived-file>
  </section>
</template>

<script>
  import MyFile from "@/views/files/myfiles";
  import WaitSign from '@/views/files/waitSign';
  import ArchivedFile from '@/views/files/archivedFile';
  export default {
    name: "index",
    data(){
      return{
        activeName:"myFiles", //myFiles-我的文件，waitSign-代签文件，archived-归档文件
        dataList:[]
      }
    },
    components:{
      MyFile,
      WaitSign,
      ArchivedFile
    },
    methods:{
      handleClick(tab,event){
        console.log(tab,event);
      },
      handleMyFiles(){
        this.activeName = "myFiles";
        //this.dataList = getFiles();
        this.$refs.myFiles.init(this.dataList);
      },
      handleWaitSign(){
        this.activeName = "waitSign";
        this.$refs.waitSignFiles.init(this.dataList);
      },
      handleArchived(){
        this.activeName = "archived";
        this.$refs.archivedFiles.init(this.dataList);
      }
    },
    activated(){
      // this.dataList = getFiles();
      // this.$refs['myFiles'].init(this.dataList);
    }
  }
</script>

<style scoped>

</style>
